import http from '../../utils/httpRequest'

export default {
  save (attrattrgrouprelation) {
    return http({
      url: `/pms/attrattrgrouprelation/save`,
      method: 'post',
      data: attrattrgrouprelation
    })
  },
  getInfo (attrId, currentPage = 1, size = 10, attrGroupId) {
    return http({
      url: `/pms/attrattrgrouprelation/list/${currentPage}/${size}`,
      method: 'post',
      data: {
        // "attrGroupId": 0,
        attrId,
        attrGroupId,
        // "attrSort": 0,
        // "id": 0
      }
    })
  },
  deleteRelation (...relationId) {
    return http({
      url: `/pms/attrattrgrouprelation/deleteBatch`,
      method: 'put',
      data: relationId
    })
  },
  deleteRelationBatch (relationId) {
    return http({
      url: `/pms/attrattrgrouprelation/deleteBatch`,
      method: 'put',
      data: relationId
    })
  },
  updateRelation (id, attrSort, attrGroupId, attrId,) {
    return http({
      url: `/pms/attrattrgrouprelation/update`,
      method: 'post',
      data: {
        id,
        attrGroupId,
        attrSort,
        attrId,

      }
    })
  },

  /**
   * 获取该属性分组可以绑定的属性
   * */
  getAvailableBindingAttr (attrGroupId, currentPage = 1, size = 10, attrId, attrName) {
    return http({
      url: `/pms/attrattrgrouprelation/getAvailableBindingAttr/${currentPage}/${size}`,
      method: 'post',
      data: {
        attrGroupId,
        //"attrGroupName": "string",
        attrId,
        attrName,
        //"attrSort": 0,
        //"id": 0
      }
    })
  }

}
